package com.springmq.mq.juc;

import com.springmq.mq.api.MqEntry;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;

/**
 * @ClassName : Demo8
 * @Author : lby
 * @Date: 2021/2/4 17:05
 * @Description :
 */
public class Demo8 {
    public static void main(String[] args) {
        List<Teacher> list=new ArrayList<Teacher>();
        Teacher teacher = new Teacher();
        for (int i = 0; i <5 ; i++) {
            teacher.setId(i);
            teacher.setName("aaaaaa");
            list.add(teacher);
        }
        list.forEach((Teacher teacher1)->{
            System.out.println(teacher1.getName());
        });
    }
}
@Data
class Teacher{
    private String name;
    private Integer id;
}